package first1

/**
  * description
  *
  * @author Llx
  * @version v1.0.0
  * @since 2018/10/8
  */
class BiBaoTest {

  /**
    * 内部（匿名）函数，使用外部函数的变量（x）
    * @param x
    * @return
    */
  def f1 (x:Int)= (y:Int)=>{x*y}

  /**
    * 柯里化形式
    * @param x
    * @param y
    * @return
    */
  def f2 (x:Int)(y:Int)={x*y}
  def apply: BiBaoTest = new BiBaoTest()
}

object BiBaoTest extends App{
  private val test = new BiBaoTest()
  private val i = test.f1(1)(2)
  println(i)

  println(test.f2(1)(2))
}